﻿<!doctype html>
<html lang="@CultureInfo.CurrentUICulture.TwoLetterISOLanguageName">
<head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <link rel="shortcut icon" href="@Url.Content("~/favicon.ico")">
    <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <title>@(ViewBag.Title ?? ResourceProvider.GetPageTitle(ViewContext.RouteData.Values))</title>

    <environment names="Development">
        <link href="~/Content/JQueryUI/jquery-ui.css" rel="stylesheet">
        <link href="~/Content/JQueryUI/jquery-ui.timepicker-addon.css" rel="stylesheet">
        <link href="~/Content/Bootstrap/bootstrap.css" rel="stylesheet">
        <link href="~/Content/FontAwesome/fa-solid.css" rel="stylesheet">
        <link href="~/Content/FontAwesome/fa-regular.css" rel="stylesheet">
        <link href="~/Content/FontAwesome/fontawesome.css" rel="stylesheet">
        <link href="~/Content/MvcLookup/mvc-lookup.css" rel="stylesheet">
        <link href="~/Content/MvcGrid/mvc-grid.css" rel="stylesheet">
        <link href="~/Content/JsTree/jstree.css" rel="stylesheet">
        <link href="~/Content/Shared/alerts.css" rel="stylesheet">
        <link href="~/Content/Shared/base.css" rel="stylesheet">
        <link href="~/Content/Shared/content.css" rel="stylesheet">
        <link href="~/Content/Shared/header.css" rel="stylesheet">
        <link href="~/Content/Shared/menu.css" rel="stylesheet">
        <link href="~/Content/Shared/overrides.css" rel="stylesheet">
        <link href="~/Content/Shared/table.css" rel="stylesheet">
        <link href="~/Content/Shared/widget-box.css" rel="stylesheet">
    </environment>
    <environment names="Staging,Production">
        <link asp-append-version="true" href="~/content/private/bundle.min.css" rel="stylesheet">
    </environment>
</head>
<body class="private">
    <div class="header">
        <div class="btn">
            <a asp-route-area="" asp-controller="Profile" asp-action="Edit">
                <span class="fa fa-user"></span>
                <span class="text">@Actions.Profile</span>
            </a>
        </div>
        @{ ILanguages languages = Context.RequestServices.GetService<ILanguages>(); }
        @if (languages.Supported.Length > 1)
        {
            <div class="btn dropdown">
                <a data-toggle="dropdown" class="dropdown-toggle" aria-expanded="true">
                    <span class="fa fa-flag"></span>
                    <span class="text">@Actions.Language</span>
                    <span class="caret"></span>
                </a>
                <div role="menu" class="dropdown-menu">
                    @foreach (Language language in languages.Supported)
                    {
                        <a class="dropdown-item" href="@Url.Action("Index", "Home", new { area = "", language = language.IsDefault ? "" : language.Abbreviation })">
                            <img src="@Url.Content($"~/Images/Flags/{language.Abbreviation}.gif")" width="16" height="11" alt="">
                            @language.Name
                        </a>
                    }
                </div>
            </div>
        }
        <div class="btn">
            <a asp-route-area="" asp-controller="Auth" asp-action="Logout">
                <span class="fa fa-share"></span>
                <span class="text">@Actions.Logout</span>
            </a>
        </div>
    </div>

    @Html.Partial("MvcLookup/_Dialog")

    <div class="content">
        <div class="menu">
            <div class="menu-search">
                <input placeholder="@(Actions.Search)..." />
            </div>
            @{ IMvcSiteMapProvider siteMap = Context.RequestServices.GetRequiredService<IMvcSiteMapProvider>(); }
            @Html.Partial("_SiteMap", siteMap.GetSiteMap(ViewContext))
        </div>
        <div class="content-container">
            <div class="separator"></div>

            <div class="content-breadcrumb">
                @{ MvcSiteMapNode[] breadcrumb = Context.RequestServices.GetRequiredService<IMvcSiteMapProvider>().GetBreadcrumb(ViewContext).ToArray(); }
                @for (Int32 i = 0; i < breadcrumb.Length; i++)
                {
                    MvcSiteMapNode node = breadcrumb[i];
                    if (i == breadcrumb.Length - 1)
                    {
                        <a class="current">
                            <span class="icon @node.IconClass"></span>
                            <span class="text">@ResourceProvider.GetSiteMapTitle(node.Area, node.Controller, node.Action)</span>
                        </a>
                    }
                    else if (node.Action != null)
                    {
                        <a asp-route-area="@node.Area" asp-controller="@node.Controller" asp-action="@node.Action">
                            <span class="icon @node.IconClass"></span>
                            <span class="text">@ResourceProvider.GetSiteMapTitle(node.Area, node.Controller, node.Action)</span>
                        </a>
                        <span class="fa fa-angle-right"></span>
                    }
                }
            </div>

            <div class="separator"></div>

            <div class="container-fluid">
                <div class="row">
                    <div class="alerts col-12">
                        @foreach (Alert alert in JsonConvert.DeserializeObject<AlertsContainer>(TempData["Alerts"] as String))
                        {
                            <div class="alert alert-@alert.Type.ToString().ToLowerInvariant()" data-timeout="@alert.Timeout">
                                <span>@alert.Message</span><span class="close">×</span>
                            </div>
                        }
                    </div>

                    @RenderBody()
                </div>
            </div>
        </div>
    </div>

    <div class="footer">
        @DateTime.Now.Year &copy; All rights reserved.
    </div>

    <environment names="Development">
        <script src="~/Scripts/JQuery/jquery.js"></script>
        <script src="~/Scripts/JQuery/jquery.validate.js"></script>
        <script src="~/Scripts/JQuery/jquery.validate.unobtrusive.js"></script>
        <script src="~/Scripts/JQuery/jquery.globalize.js"></script>
        <script src="~/Scripts/JQuery/Cultures/globalize.en.js"></script>
        <script src="~/Scripts/JQuery/Cultures/globalize.lt.js"></script>
        <script src="~/Scripts/JQueryUI/jquery-ui.js"></script>
        <script src="~/Scripts/JQueryUI/Cultures/jquery-ui.en.js"></script>
        <script src="~/Scripts/JQueryUI/Cultures/jquery-ui.lt.js"></script>
        <script src="~/Scripts/JQueryUI/jquery-ui.timepicker-addon.js"></script>
        <script src="~/Scripts/Bootstrap/bootstrap.bundle.js"></script>
        <script src="~/Scripts/MvcLookup/mvc-lookup.js"></script>
        <script src="~/Scripts/MvcLookup/Cultures/mvc-lookup.en.js"></script>
        <script src="~/Scripts/MvcLookup/Cultures/mvc-lookup.lt.js"></script>
        <script src="~/Scripts/MvcGrid/mvc-grid.js"></script>
        <script src="~/Scripts/MvcGrid/Cultures/mvc-grid.en.js"></script>
        <script src="~/Scripts/MvcGrid/Cultures/mvc-grid.lt.js"></script>
        <script src="~/Scripts/JsTree/jstree.js"></script>
        <script src="~/Scripts/Shared/Widgets/alerts.js"></script>
        <script src="~/Scripts/Shared/Widgets/menu.js"></script>
        <script src="~/Scripts/Shared/site.js"></script>
    </environment>
    <environment names="Staging,Production">
        <script asp-append-version="true" src="~/scripts/private/bundle.min.js"></script>
    </environment>
</body>
</html>
